﻿<div ng-controller="merchantController">
	<div class="wrapper border-bottom white-bg page-heading">
		<div class="col-lg-pull-12">
			<ol class="breadcrumb">
				<li><a href="javascript:void(0)" ng-click="goBack()">商户</a></li>
				<li class="active" ng-bind="breadcrumb"></li>
			</ol>
		</div>
	</div>
	<form name="_form" class="form-horizontal w5c-form" w5c-form-validate="model.setting.auth_info.validateOptions" role="form" novalidate>
		<div class="form-group form-group-sm">
			<label class="col-sm-3 control-label">姓名：</label>
			<div class="col-sm-3">
				<input type="text" name="account_name" class="form-control input-sm" ng-model="model.setting.auth_info.account_name" required>
			</div>
		</div>
		<div class="form-group form-group-sm">
			<label class="col-sm-3 control-label">身份号码：</label>
			<div class="col-sm-3">
				<input type="text" name="id_card" class="form-control input-sm" ng-model="model.setting.auth_info.id_card" required>
			</div>
		</div>
		<div class="form-group form-group-sm">
			<label class="col-sm-3 control-label">银行名称：</label>
			<div class="col-sm-3">
				<input type="text" name="bank_name" class="form-control input-sm" ng-model="model.setting.auth_info.bank_name" required>
			</div>
			<label class="col-sm-2 control-label">支行：</label>
			<div class="col-sm-3">
				<input type="text" name="branch_name" class="form-control input-sm" ng-model="model.setting.auth_info.branch_name" required>
			</div>
		</div>
		<div class="form-group form-group-sm">
			<label class="col-sm-3 control-label">银行卡号：</label>
			<div class="col-sm-3">
				<input type="text" name="account_no" class="form-control input-sm" ng-model="model.setting.auth_info.account_no" required>
			</div>
		</div>
		<div class="form-group form-group-sm">
			<label class="col-sm-3 control-label">预留手机号：</label>
			<div class="col-sm-3">
				<input type="text" name="mobile" class="form-control input-sm" ng-model="model.setting.auth_info.mobile" required>
			</div>
		</div>
		<div class="form-group form-group-sm">
			<label class="col-sm-3 control-label">微信号：</label>
			<div class="col-sm-3">
				<input type="text" name="wx_account" class="form-control input-sm" ng-model="model.setting.hf_set.wx_account" required>
			</div>
		</div>
		<div class="form-group form-group-sm">
			<label class="col-sm-3 control-label">身份证＋银行卡正面照：</label>
			<div class="col-sm-3">
				<a target="_blank" href="{{oss_img_url+model.setting.auth_info.card_positive}}"><img src="{{model.setting.auth_info.card_positive|thumbnail:128:96:oss_img_url}}" class="img-thumbnail" height="100" width="200" /></a>
			</div>
			<label class="col-sm-3 control-label">身份证反面照：</label>
			<div class="col-sm-3">
				<a target="_blank" href="{{oss_img_url+model.setting.auth_info.card_negative}}"><img src="{{model.setting.auth_info.card_negative|thumbnail:128:96:oss_img_url}}" class="img-thumbnail" height="100" width="200" /></a>
			</div>
		</div>
		<div class="form-group form-group-sm">
			<label class="col-sm-3 control-label">手持身份证+银行卡：</label>
			<div class="col-sm-3">
				<a target="_blank" href="{{oss_img_url+model.setting.auth_info.card_handheld}}"><img src="{{model.setting.auth_info.card_handheld|thumbnail:128:96:oss_img_url}}" class="img-thumbnail" height="100" width="200" /></a>
			</div>
			<label class="col-sm-3 control-label">营业执照：</label>
			<div class="col-sm-3">
				<a target="_blank" href="{{oss_img_url+model.setting.shop_info.business_license}}"><img src="{{model.setting.shop_info.business_license|thumbnail:128:96:oss_img_url}}" class="img-thumbnail" height="100" width="200" /></a>
			</div>
		</div>
		<div class="form-group form-group-sm">
			<label class="col-sm-3 control-label">不通过的原因：</label>
			<div class="col-sm-3">
				<textarea name="msg" class="form-control input-sm" ng-model="model.setting.auth_info.msg"></textarea>
			</div>
		</div>
		<div class="form-group form-group-sm">
			<label class="col-sm-3 control-label"></label>
			<div class="col-sm-9">
				<button type="button" ng-click="certifyVerifyed(model.id)" class="btn btn-primary btn-sm" btn-loading="psdisabled" ng-disabled="psdisabled" loading-text="提交..">
					<i class="fa fa-save"></i> 验证实名
				</button>
				&nbsp;
				<button type="button" ng-click="authedit(model.id,model.setting.auth_info)" class="btn btn-primary btn-sm" btn-loading="psdisabled" ng-disabled="psdisabled" loading-text="提交..">
					<i class="fa fa-save"></i> 修改
				</button>
				&nbsp;
				<button type="button" ng-click="audit(model.id,model.setting.auth_info,3)" class="btn btn-primary btn-sm" btn-loading="psdisabled" ng-disabled="psdisabled" loading-text="提交..">
					<i class="fa fa-save"></i> 审核通过
				</button>
				&nbsp;
				<button type="button" ng-click="audit(model.id,model.setting.auth_info,2,model.setting.auth_info.msg)" class="btn btn-primary btn-sm" btn-loading="psdisabled" ng-disabled="psdisabled" loading-text="提交..">
					<i class="fa fa-save"></i> 审核不通过
				</button>
			</div>
		</div>
		<div class="form-group form-group-sm">
			<label class="col-sm-3 control-label"></label>
			<div class="col-sm-9">
				<button type="button" ng-click="wxaudit(model.id,4)" class="btn btn-primary btn-sm" btn-loading="psdisabled" ng-disabled="psdisabled" loading-text="提交..">
					<i class="fa fa-save"></i> 提交微信认证
				</button>
				&nbsp;
				<button type="button" ng-click="wxaudit(model.id,3)" class="btn btn-primary btn-sm" btn-loading="psdisabled" ng-disabled="psdisabled" loading-text="提交..">
					<i class="fa fa-save"></i> 微信扫码审核通过
				</button>
				&nbsp;
				<button type="button" ng-click="wxaudit(model.id,2,model.setting.auth_info.msg)" class="btn btn-primary btn-sm" btn-loading="psdisabled" ng-disabled="psdisabled" loading-text="提交..">
					<i class="fa fa-save"></i> 微信扫码审核不通过
				</button>
				<br>
				支付目录：{{model.setting.hf_set.notify!=null?model.setting.hf_set.notify.replace('open/open_native_notify','native/'):''}} {{model.setting.hf_set.open_wx==3?',当前状态认证通过':''}}
			</div>
		</div>
		<table class="table table-hover" ng-if="model.id>0">
			<thead>
				<tr>
					<th>通道</th>
					<th width="40">结算</th>
					<th>商户号</th>
					<th width="100">银行</th>
					<th>姓名</th>
					<th>账号</th>
					<th>手机</th>
					<th>操作</th>
				</tr>
			</thead>
			<tbody>
				<tr ng-repeat="item in model.registers">
					<td>{{item.pay_channel|channel_name}}({{item.pay_channel}})</td>
					<td>{{item.settle_type}}</td>
					<td>{{item.merchant_no}}</td>
					<td>{{item.bank_name}}</td>
					<td>{{item.account_no}}</td>
					<td>{{item.account_name}}</td>
					<td>{{item.mobile}}</td>
					<td>
						<button type="button" ng-click="add_merchant(model.id,item.pay_channel,item.settle_type,item.account_no)" class="btn btn-primary btn-xs" btn-loading="psdisabled" ng-disabled="psdisabled" loading-text="提交..">
		                    <i class="fa fa-save"></i> 原进件
		                </button>
						<button type="button" ng-click="auth_register(model.id,item.pay_channel,item.settle_type)" class="btn btn-primary btn-xs" btn-loading="psdisabled" ng-disabled="psdisabled" loading-text="提交..">
		                    <i class="fa fa-save"></i> 实名进件
		                </button>
						<button type="button" ng-click="auth_register_del(item.id)" class="btn btn-primary btn-xs" btn-loading="psdisabled" ng-disabled="psdisabled" loading-text="提交..">
		                    <i class="fa fa-trash"></i> 删除
		                </button>
					</td>
				</tr>
			</tbody>
			<tbody>
				<tr>
					<td colspan="8">未进件通道</td>
				</tr>
			</tbody>
			<tbody ng-repeat="item in model.payments">
				<tr ng-repeat="settle in item.settles" ng-if="is_register(item.payment,settle.settle_type,model.registers)">
					<td>{{item.payment.channel|channel_name}}({{item.payment.channel}})</td>
					<td>{{settle.settle_type}}</td>
					<td></td>
					<td></td>
					<td></td>
					<td></td>
					<td></td>
					<td>
						<button type="button" ng-click="add_merchant(model.id,item.payment.channel,settle.settle_type)" class="btn btn-primary btn-xs" btn-loading="psdisabled" ng-disabled="psdisabled" loading-text="提交..">
		                    <i class="fa fa-save"></i> 进件
		                </button>
					</td>
				</tr>
			</tbody>
		</table>
	</form>
</div>
